import { get, post, put, del } from './request'

// 接口返回数据类型定义
interface ResponseData<T> {
  code: number
  data: T
  message: string
}

// 示例接口
export const api = {
  // 获取用户信息
  getUserInfo: (userId: string) => {
    return get<ResponseData<any>>(`/user/${userId}`)
  },
  
  // 用户登录
  login: (data: { username: string; password: string }) => {
    return post<ResponseData<any>>('/auth/login', data)
  },

  // 更新用户信息
  updateUser: (userId: string, data: any) => {
    return put<ResponseData<any>>(`/user/${userId}`, data)
  },

  // 删除用户
  deleteUser: (userId: string) => {
    return del<ResponseData<any>>(`/user/${userId}`)
  }
}
